<template>
  <div>
    <el-card class="box-card">
      <div slot="header" class="clearfix" style="text-align: center;line-height: 30px">
        <h3>查看角色权限</h3>
      </div>

      <div class="text item">
        <el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm">

          <el-row>
            <el-col :span="12"><div class="grid-content bg-purple">
              <span>角色名称:&nbsp;&nbsp;&nbsp;&nbsp;</span><br>
              <span>{{ruleForm.name}}</span>
            </div></el-col>
          </el-row>
          <br><br>

          <el-row>
            <el-col :span="24"><div class="grid-content bg-purple">
              <span>拥有权限:&nbsp;&nbsp;&nbsp;&nbsp;</span><br>
              <span>{{ruleForm.power}}</span>
            </div></el-col>
          </el-row>
          <br>
          <br>

          <el-row>
            <div style="text-align: center">
              <el-form-item>
                <el-button type="primary" @click="onSubmit">确定</el-button>
              </el-form-item>
            </div>
          </el-row>
        </el-form>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "SelectRolePower",

  data(){
    return{
      gradeList:'',
      solename:'',
      ruleForm:{
        name:'',
        power:'',
      }
    }
  },
  mounted() {
    this.init()
  },
  methods:{
    init(){
      let id = this.$store.state.soleid
      let url = "api/sole/findById?id="+id
      this.$axios.post(url).then(r=>{
        console.log(r.data)
        this.ruleForm.name=r.data.solename
        this.ruleForm.power = r.data.gradeList
      })
    },
    onSubmit(){
      this.$router.push("RoleView")
    }
  }
}
</script>

<style scoped>

</style>